<script>
	import initApp from '@/common/appInit.js';
	import uniIdPageInit from '@/uni_modules/uni-id-pages/init.js';

	import {
		mapActions,
	} from 'vuex';
	export default {
		globalData: {
			searchText: '',
			searchShopText: '',
			appVersion: {},
			config: {},
			$i18n: {},
			$t: {}
		},
		onLaunch: function() {
			console.log('App Launch')
			// this.globalData.$i18n = this.$i18n
			// this.globalData.$t = str => this.$t(str)
			initApp();
			uniIdPageInit()
			uni.$on('uni-id-pages-login-success', () => {
				console.log('App接收到登录成功');
				// 调用store的getUserInfo()方法补齐userInfo参数并保存本地
				this.getUserInfo()
			})
			// this.adjustRootFontSize(); // 应用启动时调整根字体大小
		},
		onShow: function() {
			console.log('App Show')
			// uni.onWindowResize(this.adjustRootFontSize)
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			...mapActions({
				getUserInfo: 'user/getUserInfo',
			})
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	/* #ifndef APP-NVUE */
	@import '@/common/uni-admin.css';
	@import "common/css/style.scss";
	/* tiantian 的全局样式 */
	@import "common/css/font_2479288_9cqg4e7ml9.css";
	@import "common/css/theme.scss";
	/* #endif */

	/* #ifdef H5 */
	@media screen and (min-width:960px) {

		/* pc宽屏 隐藏会话页面头部 && 全局底部导航 以下兼容了Vue2和3两种模式的样式*/
		uni-page[data-page="uni_modules/uni-im/pages/index/index"] uni-page-head,
		.uni_modules-uni-im-pages-index-index uni-page-head,
		uni-tabbar,
		.uni-app--showtabbar uni-page-wrapper::after {
			display: none !important;
		}
	}

	/* #endif */

	/* #ifndef APP-NVUE */
	@import "@/uni_modules/uni-im/static/iconfont.css";
	/* #endif */

	/* 解决checkbox复选框的颜色属性在微信小程序中无效的问题 */
	/* 组件的大小在使用页面通过 transform: scale(0.7);解决*/
	/* style="transform: scale(0.7);margin-right: -6px;" */
	/* #ifdef MP-WEIXIN */
	checkbox .wx-checkbox-input {
		border-radius: 50%;
		/* 使未选中的复选框也是圆形 */
	}

	checkbox .wx-checkbox-input.wx-checkbox-input-checked {
		background-color: #1485EE !important;
		border: 1px solid #1485EE !important;
		color: #FFFFFF !important;
		border-radius: 50%;
	}

	/* #endif */
</style>